package com.example.proxy.util;

import com.example.proxy.service.OrderService;
import com.example.proxy.service.TimerInvocationHandler;

import java.lang.reflect.Proxy;

/**
 * ClassName:ProxyUtil
 * Package:com.example.proxy.util
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/10-16:36
 * @Version:v1.0
 */
public class ProxyUtil {

    public static Object newProxyInstance(Object target) {

        return Proxy.newProxyInstance(target.getClass().getClassLoader(),
                target.getClass().getInterfaces(),
                new TimerInvocationHandler(target));
    }

}
